#include "StdAfx.h"
#include "OleDropTargetEx.h"
#include "ListCtrlEx.h"

DROPEFFECT COleDropTargetEx::OnDragEnter(CWnd* pWnd, COleDataObject* pDataObject, DWORD dwKeyState, CPoint point)
{
     CListCtrlEx*     pListCtrlEx = NULL;
     ASSERT_VALID(this);
     ASSERT(IsWindow(pWnd->m_hWnd));
     if( pWnd->IsKindOf(RUNTIME_CLASS(CListCtrlEx)) )
     {
         pListCtrlEx = (CListCtrlEx*)pWnd;
         return pListCtrlEx->OnDragEnter(pWnd, pDataObject, dwKeyState, point);
     } else
         return COleDropTarget::OnDragEnter(pWnd, pDataObject, dwKeyState, point);    
}

DROPEFFECT COleDropTargetEx::OnDragOver(CWnd* pWnd, COleDataObject* pDataObject, DWORD dwKeyState, CPoint point)
{
     CListCtrlEx*     pListCtrlEx = NULL;
     ASSERT_VALID(this);
     ASSERT(IsWindow(pWnd->m_hWnd));
     if( pWnd->IsKindOf(RUNTIME_CLASS(CListCtrlEx)) )
     {
         pListCtrlEx = (CListCtrlEx*)pWnd;
         return pListCtrlEx->OnDragOver(pWnd, pDataObject, dwKeyState, point);
     } else
         return COleDropTarget::OnDragOver(pWnd, pDataObject, dwKeyState, point);    
}

DROPEFFECT COleDropTargetEx::OnDropEx(CWnd* pWnd, COleDataObject* pDataObject, DROPEFFECT dropEffect, DROPEFFECT dropList, CPoint point)
{
     CListCtrlEx*     pListCtrlEx = NULL;
     ASSERT_VALID(this);
     ASSERT(IsWindow(pWnd->m_hWnd));
     if( pWnd->IsKindOf(RUNTIME_CLASS(CListCtrlEx)) )
     {
         pListCtrlEx = (CListCtrlEx*)pWnd;
         return pListCtrlEx->OnDropEx(pWnd, pDataObject, dropEffect, dropList, point);
     } else
         return COleDropTarget::OnDropEx(pWnd, pDataObject, dropEffect, dropList, point);    
}

BOOL COleDropTargetEx::OnDrop(CWnd* pWnd, COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoint point)
{
     CListCtrlEx*     pListCtrlEx = NULL;
     ASSERT_VALID(this);
     ASSERT(IsWindow(pWnd->m_hWnd));
     if( pWnd->IsKindOf(RUNTIME_CLASS(CListCtrlEx)) )
     {
         pListCtrlEx = (CListCtrlEx*)pWnd;
         return pListCtrlEx->OnDrop(pWnd, pDataObject, dropEffect, point);
     } else
         return COleDropTarget::OnDrop(pWnd, pDataObject, dropEffect, point);    
}

void COleDropTargetEx::OnDragLeave(CWnd* pWnd)
{
     CListCtrlEx*     pListCtrlEx = NULL;
     ASSERT_VALID(this);
     ASSERT(IsWindow(pWnd->m_hWnd));
     if( pWnd->IsKindOf(RUNTIME_CLASS(CListCtrlEx)) )
     {
         pListCtrlEx = (CListCtrlEx*)pWnd;
         return pListCtrlEx->OnDragLeave(pWnd);
     } else
         return COleDropTarget::OnDragLeave(pWnd);    
}
